﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 邮件模板
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("邮件模板")]
	[BindTable("app_EmailTemplate", Description = "邮件模板", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_EmailTemplate
	{
		#region 属性
		private Int32 _E_ID;
		/// <summary>
		/// 模板编号
		/// </summary>
		[Description("模板编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "E_ID", "模板编号", "", "int", 10, 0, false)]
		public Int32 E_ID
		{
			get { return _E_ID; }
			set { if (OnPropertyChange("E_ID", value)) _E_ID = value; }
		}

		private String _E_Code;
		/// <summary>
		/// 模板编码
		/// </summary>
		[Description("模板编码")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "E_Code", "模板编码", "", "varchar(10)", 0, 0, false)]
		public String E_Code
		{
			get { return _E_Code; }
			set { if (OnPropertyChange("E_Code", value)) _E_Code = value; }
		}

		private Int32 _E_Type;
		/// <summary>
		/// 模板类型(0.普通模板,1.系统模板)
		/// </summary>
		[Description("模板类型(0.普通模板,1.系统模板)")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(3, "E_Type", "模板类型(0.普通模板,1.系统模板)", "", "tinyint", 3, 0, false)]
		public Int32 E_Type
		{
			get { return _E_Type; }
			set { if (OnPropertyChange("E_Type", value)) _E_Type = value; }
		}

		private String _E_Name;
		/// <summary>
		/// 模板名称
		/// </summary>
		[Description("模板名称")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(4, "E_Name", "模板名称", "", "nvarchar(50)", 0, 0, true)]
		public String E_Name
		{
			get { return _E_Name; }
			set { if (OnPropertyChange("E_Name", value)) _E_Name = value; }
		}

		private String _E_Content;
		/// <summary>
		/// 模板内容
		/// </summary>
		[Description("模板内容")]
		[DataObjectField(false, false, true, 1073741823)]
		[BindColumn(5, "E_Content", "模板内容", "", "ntext", 0, 0, true)]
		public String E_Content
		{
			get { return _E_Content; }
			set { if (OnPropertyChange("E_Content", value)) _E_Content = value; }
		}

		private Int32 _E_LastUserID;
		/// <summary>
		/// 创建人
		/// </summary>
		[Description("创建人")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(6, "E_LastUserID", "创建人", "", "int", 10, 0, false)]
		public Int32 E_LastUserID
		{
			get { return _E_LastUserID; }
			set { if (OnPropertyChange("E_LastUserID", value)) _E_LastUserID = value; }
		}

		private DateTime _E_LastTime;
		/// <summary>
		/// 创建时间
		/// </summary>
		[Description("创建时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(7, "E_LastTime", "创建时间", "getdate()", "datetime", 3, 0, false)]
		public DateTime E_LastTime
		{
			get { return _E_LastTime; }
			set { if (OnPropertyChange("E_LastTime", value)) _E_LastTime = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "E_ID" : return _E_ID;
					case "E_Code" : return _E_Code;
					case "E_Type" : return _E_Type;
					case "E_Name" : return _E_Name;
					case "E_Content" : return _E_Content;
					case "E_LastUserID" : return _E_LastUserID;
					case "E_LastTime" : return _E_LastTime;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "E_ID" : _E_ID = Convert.ToInt32(value); break;
					case "E_Code" : _E_Code = Convert.ToString(value); break;
					case "E_Type" : _E_Type = Convert.ToInt32(value); break;
					case "E_Name" : _E_Name = Convert.ToString(value); break;
					case "E_Content" : _E_Content = Convert.ToString(value); break;
					case "E_LastUserID" : _E_LastUserID = Convert.ToInt32(value); break;
					case "E_LastTime" : _E_LastTime = Convert.ToDateTime(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得邮件模板字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 模板编号
			///</summary>
			public const String E_ID = "E_ID";

			///<summary>
			/// 模板编码
			///</summary>
			public const String E_Code = "E_Code";

			///<summary>
			/// 模板类型(0.普通模板,1.系统模板)
			///</summary>
			public const String E_Type = "E_Type";

			///<summary>
			/// 模板名称
			///</summary>
			public const String E_Name = "E_Name";

			///<summary>
			/// 模板内容
			///</summary>
			public const String E_Content = "E_Content";

			///<summary>
			/// 创建人
			///</summary>
			public const String E_LastUserID = "E_LastUserID";

			///<summary>
			/// 创建时间
			///</summary>
			public const String E_LastTime = "E_LastTime";
		}
		#endregion
	}
}